package br.com.gestacard.sync.entidade;


import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.MappedSuperclass;

import org.hibernate.annotations.ForeignKey;
@MappedSuperclass
public abstract class ContaCorrente extends AppBaseEntity {

	private static final long serialVersionUID = 7954122271893742573L;

	
	@Id @GeneratedValue(strategy=GenerationType.AUTO, generator = "SE_CONTA_CORRENTE")
	@Column (name = "ID_CONTA_CORRENTE", nullable=false, length=5)
	private Long id;
	
	@Column (name = "ID_CONTA_CORRENTE", nullable=false, length=5, insertable=false, updatable=false)
	private Long codigo;
	
	@ManyToOne (targetEntity = BancoEntity.class, fetch = FetchType.LAZY)
	@ForeignKey(name="FK_CONTA_CORRENTE_BANCO")
	@JoinColumn (name = "ID_BANCO", nullable=false)
	private Banco banco;
	
	@Column (name = "AGENCIA", nullable=false, length=10)
	private Long agencia;
	
	@Column (name = "DV_AGENCIA", nullable=true, length=2)
	private String dvAgencia;
	
	@Column (name = "CONTA", nullable=false, length=10)
	private Long conta;
	
	@Column (name = "DV_CONTA", nullable=true, length=2)
	private String dvConta;
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id=id;
	}

	public Banco getBanco() {
		return banco;
	}

	public void setBanco(Banco banco) {
		this.banco=banco;
	}

	public Long getAgencia() {
		return agencia;
	}

	public void setAgencia(Long agencia) {
		this.agencia=agencia;
	}

	public String getDvAgencia() {
		return dvAgencia;
	}

	public void setDvAgencia(String dvAgencia) {
		this.dvAgencia=dvAgencia;
	}

	public Long getConta() {
		return conta;
	}

	public void setConta(Long conta) {
		this.conta=conta;
	}

	public String getDvConta() {
		return dvConta;
	}

	public void setDvConta(String dvConta) {
		this.dvConta=dvConta;
	}

	public Long getCodigo() {
		return codigo;
	}

	public void setCodigo(Long codigo) {
		this.codigo = codigo;
	}

}
